home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.tree;
-
- import java.util.Enumeration;
- import java.util.NoSuchElementException;
-
- class FixedHeightLayoutCache$VisibleFHTreeStateNodeEnumeration implements Enumeration {
- // $FF: synthetic field
- private final FixedHeightLayoutCache this$0;
- protected FixedHeightLayoutCache.FHTreeStateNode parent;
- protected int nextIndex;
- protected int childCount;
-
- protected FixedHeightLayoutCache$VisibleFHTreeStateNodeEnumeration(FixedHeightLayoutCache var1, FixedHeightLayoutCache.FHTreeStateNode var2) {
- this(var1, var2, -1);
- }
-
- protected FixedHeightLayoutCache$VisibleFHTreeStateNodeEnumeration(FixedHeightLayoutCache var1, FixedHeightLayoutCache.FHTreeStateNode var2, int var3) {
- this.this$0 = var1;
- this.parent = var2;
- this.nextIndex = var3;
- this.childCount = var1.treeModel.getChildCount(this.parent.getUserObject());
- }
-
- protected boolean findNextValidParent() {
- if (this.parent == FixedHeightLayoutCache.access$6(this.this$0)) {
- this.parent = null;
- return false;
- } else {
- while(this.parent != null) {
- FixedHeightLayoutCache.FHTreeStateNode var1 = (FixedHeightLayoutCache.FHTreeStateNode)this.parent.getParent();
- if (var1 != null) {
- this.nextIndex = this.parent.childIndex;
- this.parent = var1;
- this.childCount = this.this$0.treeModel.getChildCount(this.parent.getUserObject());
- if (this.updateNextIndex()) {
- return true;
- }
- } else {
- this.parent = null;
- }
- }
-
- return false;
- }
- }
-
- public boolean hasMoreElements() {
- return this.parent != null;
- }
-
- public Object nextElement() {
- if (!this.hasMoreElements()) {
- throw new NoSuchElementException("No more visible paths");
- } else {
- TreePath var1;
- if (this.nextIndex == -1) {
- var1 = this.parent.getTreePath();
- } else {
- FixedHeightLayoutCache.FHTreeStateNode var2 = this.parent.getChildAtModelIndex(this.nextIndex);
- if (var2 == null) {
- var1 = this.parent.getTreePath().pathByAddingChild(this.this$0.treeModel.getChild(this.parent.getUserObject(), this.nextIndex));
- } else {
- var1 = var2.getTreePath();
- }
- }
-
- this.updateNextObject();
- return var1;
- }
- }
-
- protected boolean updateNextIndex() {
- if (this.nextIndex == -1 && !this.parent.isExpanded()) {
- return false;
- } else if (this.childCount == 0) {
- return false;
- } else if (++this.nextIndex >= this.childCount) {
- return false;
- } else {
- FixedHeightLayoutCache.FHTreeStateNode var1 = this.parent.getChildAtModelIndex(this.nextIndex);
- if (var1 != null && var1.isExpanded()) {
- this.parent = var1;
- this.nextIndex = -1;
- this.childCount = this.this$0.treeModel.getChildCount(((DefaultMutableTreeNode)var1).getUserObject());
- }
-
- return true;
- }
- }
-
- protected void updateNextObject() {
- if (!this.updateNextIndex()) {
- this.findNextValidParent();
- }
-
- }
- }
-